﻿package net.wangit.framework.session;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * Session工具类，初始化Session
 * 
 * @author watson
 * 
 */
public class AgileSessionUtil {

	private AgileSessionUtil() {
	}

	public static final void initSession(HttpServletRequest request) {
		HttpSession httpSession = request.getSession();
		AgileSession session = (AgileSession) httpSession
				.getAttribute(AgileSession.KEY);
		if (session == null) {
			session = new AgileSession();
			httpSession.setAttribute(AgileSession.KEY, session);
		}
	}
}
